package com.igeek.boot;

import com.igeek.boot.config.MyConfig1;
import com.igeek.boot.entity.Car;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringBootTest {
    public static void main(String[] args) {

        ConfigurableApplicationContext applicationContext = SpringApplication.run(SpringBootTest.class,args);
        //String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        /*for (String name:beanDefinitionNames
             ) {
            System.out.println(name);
        }*/
        System.out.println("======================MyConfig1=======================");
        MyConfig1 myConfig1 = applicationContext.getBean("myConfig1", MyConfig1.class);
        System.out.println("myConfig1 = " + myConfig1);
        Car car = applicationContext.getBean("car", Car.class);
        System.out.println("car = " + car);
    }
}
